module.exports = function ($scope, $resource, $modalInstance, info, toaster) {

	$scope.detail = {
		'supplier_company_code': info.supplier_company_code,
		'send_sms_price': info.send_sms_price,
		'send_sms_mobile': info.send_sms_mobile,
		'send_sms_flag': info.send_sms_flag,
	};
	
	//保存
	$scope.save = function() {
		$resource('/api/as/pc/bmaccount/updateBmAccountInfo', {}, {}).save($scope.detail, function(res){
			if(res.errcode === 0){
				toaster.success({title: '', body: '修改成功'});
				$modalInstance.close($scope.detail);
			} else {
				toaster.error({title: '', body: '修改失败'});
			}
		});
	}

	//取消
	$scope.cancel = function() {
        $modalInstance.dismiss('cancel'); 
	};

};